package mediadisplay.ui.colors 
{
	import flash.display.Sprite;
	import flash.events.Event;
	/**
	 * ...
	 * @author Anders Figenschow selvfølgelig
	 */
	public class Shortcut extends Sprite
	{
		public var color:uint = 0;
		public var index:int;
		
		public function Shortcut(index:int) 
		{
			this.index = index;
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
			
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			draw(color);
		}
		
		public function draw(color:uint):void 
		{
			graphics.clear();
			graphics.lineStyle(1, 0xffffff);
			graphics.beginFill(color);
			graphics.drawRect(0, 0, 10, 10);
			this.color = color;
			cacheAsBitmap = true;
		}
		
	}

}